home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / src / netlib / strerror.c < prev    next >
C/C++ Source or Header  |  1994-09-29  |  2KB  |  61 lines

  1. RCS_ID_C="$Id: strerror.c,v 4.1 1994/09/29 23:09:02 jraja Exp $";
  2. /*
  3.  *      strerror.c - network errno support for AmiTCP/IP
  4.  *
  5.  *      Copyright © 1994 AmiTCP/IP Group, 
  6.  *                       Network Solutions Development Inc.
  7.  *                       All rights reserved.
  8.  */
  9.  
  10. #include <errno.h>
  11. #include <bsdsocket.h>
  12. #include <amitcp/socketbasetags.h>
  13.  
  14. /****** net.lib/strerror *****************************************************
  15.  
  16.     NAME
  17.         strerror -- return the text for given error number
  18.  
  19.     SYNOPSIS
  20.         string = strerror(error);
  21.  
  22.         char * strerror(int);
  23.  
  24.     FUNCTION
  25.         This function returns pointer to the (English) string describing the
  26.         error code given as argument. The error strings are defined for the
  27.         error codes defined in <sys/errno.h>.
  28.  
  29.     NOTES
  30.         The string pointed to by the return value should not be modified by
  31.         the program, but may be overwritten by a subsequent call to this
  32.         function.
  33.  
  34.     BUGS
  35.         The strerror() prototype should be 
  36.     const char *strerror(unsigned int); 
  37.     However, the SAS C includes define it differently.
  38.  
  39.     SEE ALSO
  40.         <netinclude:sys/errno.h>, perror(), PrintNetFault()
  41. *****************************************************************************
  42. */
  43.  
  44. #ifdef notyet
  45. const char *
  46. strerror(unsigned int error)
  47. #else
  48. char *
  49. strerror(int error)
  50. #endif
  51. {
  52.   ULONG taglist[3];
  53.  
  54.   taglist[0] = SBTM_GETVAL(SBTC_ERRNOSTRPTR);
  55.   taglist[1] = error;
  56.   taglist[2] = TAG_END;
  57.  
  58.   SocketBaseTagList((struct TagItem *)taglist);
  59.   return (char *)taglist[1];
  60. }
  61.